#include "not.h"
#include "course.h"

Not::Not(shared_ptr<Requirement> req) :
    req_(req)
{
}

/// Checks if the logical negation of the requirement is fulfilled.
/// \param context Merely fulfills the interface signature of the function.
/// Not used.
/// \return True if the logical negation of the requirement is fulfilled.
/// False otherwise.
bool Not::evaluate(Context& context)
{
    return ! req_->evaluate(context);
}

/// Generates a string representation of the negation expression.
/// \param context Merely fulfills the interface signature of the function.
/// Not used.
/// \return The string representation of the negation expression.
std::string Not::to_string(Context& context)
{
    return "NOT " + req_->to_string(context);
}

/// Counts the requirements in this negation expression.
/// \param context Merely fulfills the interface signature of the function.
/// Not used.
/// \return The number of requirements in this negation expression.
std::size_t Not::count(Context& context)
{
    return req_->count(context);
}

/// Gets the Course objects in this negation expression.
/// \return A list of all Course objects in this negation expression.
std::list<Course> Not::courses()
{
    return req_->courses();
}
